
<!-- aad users -->
<script id="services.aad.users.partial" type="text/x-handlebars-template">
    <div id="resource-name" class="list-group-item active">
        <h4 class="list-group-item-heading">{{name}}</h4>
    </div>
    <div class="list-group-item">
        <h4 class="list-group-item-heading">Information</h4>
        <div class="list-group-item-text item-margin">Principal Name: <span id="aad.users.{{@key}}.user_principal_name"><samp>{{value_or_none name}}</samp></span></div>
        <div class="list-group-item-text item-margin">Display Name: <span id="aad.users.{{@key}}.display_name"><samp>{{value_or_none display_name}}</samp></span></div>
        <div class="list-group-item-text item-margin">Given Name: <span id="aad.users.{{@key}}.given_name"><samp>{{value_or_none given_name}}</samp></span></div>
        <div class="list-group-item-text item-margin">Surname: <span id="aad.users.{{@key}}.surname"><samp>{{value_or_none surname}}</samp></span></div>
        <div class="list-group-item-text item-margin">Mail Nickname: <span id="aad.users.{{@key}}.mail_nickname"><samp>{{value_or_none mail_nickname}}</samp></span></div>
        <div class="list-group-item-text item-margin">Mail: <span id="aad.users.{{@key}}.mail"><samp>{{value_or_none mail}}</samp></span></div>
        <div class="list-group-item-text item-margin">Sign-In Names: <span id="aad.users.{{@key}}.sign_in_names"><samp>{{value_or_none sign_in_names}}</samp></span></div>
        <div class="list-group-item-text item-margin">Type: <span id="aad.users.{{@key}}.user_type"><samp>{{value_or_none user_type}}</samp></span></div>
        <div class="list-group-item-text item-margin">Status: <span id="aad.users.{{@key}}.account_enabled">{{convert_bool_to_enabled account_enabled}}</span></div>
        <div class="list-group-item-text item-margin">Usage Location: <span id="aad.users.{{@key}}.usage_location"><samp>{{value_or_none usage_location}}</samp></span></div>
        <div class="list-group-item-text item-margin">Deletion Timestamp: <span id="aad.users.{{@key}}.deletion_timestamp"><samp>{{value_or_none deletion_timestamp}}</samp></span></div>
    </div>
    <div class="list-group-item">
        <h4 class="list-group-item-heading" id="aad.users.{{@key}}.roles">Roles
            {{> count_badge count=roles.length}}
        </h4>
        <div class="accordion-inner">
            <ul>
                {{#each roles}}
                <li class="list-group-item-text"><a href="javascript:showObject('services.rbac.subscriptions.{{this.subscription_id}}.roles', 'id', '{{this.role_id}}')">{{getValueAt 'services.rbac.subscriptions' this.subscription_id 'roles' this.role_id 'name'}}</a> (subscription <samp>{{this.subscription_id}}</samp>)</li></a></li>
                {{/each}}
            </ul>
        </div>
    </div>
    <div class="list-group-item">
        <h4 class="list-group-item-heading">Groups
            {{> count_badge count=groups.length}}
        </h4>
        <div class="accordion-inner">
            <ul>
                {{#each groups}}
                <li class="list-group-item-text"><a href="javascript:showObject('services.aad.groups', 'id', '{{this}}')">{{getValueAt 'services.aad.groups' this 'name'}}</a></li></a></li>
                {{/each}}
            </ul>
        </div>
    </div>
</script>

<script>
    Handlebars.registerPartial("services.aad.users", $("#services\\.aad\\.users\\.partial").html());
</script>

<!-- Single aad user template -->
<script id="single_aad_user-template" type="text/x-handlebars-template">
    {{> modal-template template='services.aad.users'}}
</script>
<script>
    var single_aad_user_template = Handlebars.compile($("#single_aad_user-template").html());
</script>
